<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<div class="panel-group" id="accordion">
	<c:if test="${empty resources}">
		<c:set scope="request" var="resources" value="${sessionInfo.resources}" />
	</c:if>
	<c:forEach items="${resources}" var="resource">
		<div class="panel panel-default">
			<div class="panel-heading" onclick="location.href='${pageContext.request.contextPath}${resource.url}';">
				<h4 class="panel-title">
					<a data-toggle="collapse" data-parent="#${resource.pid}" href="#${resource.id}">${resource.name}</a>
				</h4>
			</div>
			<c:if test="${fn:length(resource.resources)>0}">
				<div id="${resource.id}" class="panel-collapse collapse in">
					<div class="panel-body">
						<c:set var="resources" value="${resource.resources}" scope="request" />
						<c:import url="leftMenu.jsp" />
					</div>
				</div>
			</c:if>
		</div>
	</c:forEach>
</div>